import { demandStatus } from './status'
// * 需求接收table字段
export const demandTableColumn = [
  {
    name: "需求单号",
    value: "needsCode",
    width: '180px',
    render: (h, { row, listeners }) => {
      return h('div', {}, [
        h('span', {
          class: `
          ${ row.closeState  === 1? 'needsFinished': '' }
          ${ row.suspendState  === 1? 'pause': '' }
          ${ row.suspendState  === 2? 'restore': '' }
          ${ row.closeState === 2? 'close': '' }
          `,
        }, [
          h('span', {}, row.needsCode),
          row.reuse === 1? h('span', { class: 'multiplex' }, ''): '',
        ])
      ])
    }
  },
  {
    name: "岗位名称",
    value: "positionName",
  },
  {
    name: "一级部门",
    value: "oneLevel",
  },
  {
    name: "二级部门",
    value: "towLevel",
  },
  {
    name: "三级部门",
    value: "threeLevel",
  },
  {
    name: "四级部门",
    value: "fourLevel",
  },
  {
    name: "五级部门",
    value: "fiveLevel",
  },
  {
    name: "需求人数",
    value: "needsNumber",
  },
  {
    name: "期望入场时间",
    value: "beginTime",
    width: '110px'
  },
  {
    name: "需求状态",
    render: (h, { row }) => {
      return h('span', {
        class: `${demandStatus[row.state].className}`
      } , [
        h('span', {
          class: 'circle'
        }, null),
        h('span', null, demandStatus[row.state].label)
      ])
    }
  },
  {
    name: "操作",
    type: "operate",
    width: "80px",
    fixed: "right",
    render: (h, { row, listeners }) => {
      return  h(
        "span",
        {
          class: "cursor table-btn table-blue-btn",
          on: {
            click: function () {
              listeners.click("onLookDetail");
            },
          },
        },
        "查看"
      )
    },
  },
]
